package com.wuyan.locationdog.util

import com.xw.repo.BubbleSeekBar

/**
 * 优化BubbleSeekBar
 */
fun BubbleSeekBar.getProgressOnActionUp(getProgressOnActionUp: (Int) -> Unit) {
    this.onProgressChangedListener = (object : BubbleSeekBar.OnProgressChangedListener {

        override fun onProgressChanged(bubbleSeekBar: BubbleSeekBar?, progress: Int, progressFloat: Float, fromUser: Boolean) {
        }

        override fun getProgressOnActionUp(bubbleSeekBar: BubbleSeekBar?, progress: Int, progressFloat: Float) {
            getProgressOnActionUp.invoke(progress)
        }

        override fun getProgressOnFinally(bubbleSeekBar: BubbleSeekBar?, progress: Int, progressFloat: Float, fromUser: Boolean) {
        }
    })
}